<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<?php
$header = $_REQUEST['header'];

if (!isset($unum)) {
   $unum = $_COOKIE['TPMunum'];
}

if (!isset($rstufe)) {
   $rstufe = $_COOKIE['TPMrstufe'];
}

if (isset($unum) && isset($rstufe) && strlen($unum) > 10) {
   $unum = substr($unum, 32);
   $rstufe = substr($rstufe, 32);
}

$title_str = urldecode($title_str);
?>
<html>
<head>
	<title><? echo "$title_str $strVersion"; ?></title>
	<meta name="Description" content="Project Manager">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<META name="Author" content="Andreas Theofilu">
	<META name="Publisher" content="Andreas Theofilu = TheoSys">
	<META name="Copyright" content="Andreas Theofilu">
	<META name="Content-language" content="de">
<?php
if (isset($header) && $header == 2)
	echo "<LINK href=\"pstile.css\" rel=\"stylesheet\" type=\"text/css\">\n";
else
	echo "<LINK href=\"stile.css\" rel=\"stylesheet\" type=\"text/css\">\n";
?>
<SCRIPT type="text/javascript">
var DocChanged = false;
</SCRIPT>
<script src="browser.js" type="text/javascript">
</script>
<SCRIPT type="text/javascript">
function Farb(R,G,B) {
  var Rx = dx(R);
  var Gx = dx(G);
  var Bx = dx(B);
  var color = Rx+Gx+Bx;
  window.opener.document.Task.ta_color.value = color;
}
document.onkeypress = Tastendruck;
</script>
</head>
<body<? echo "$onLoad"; ?>>
<?php
if (!isset($header) || $header == 3) {
   if ($header != 3 && isset($unum) && $unum > 0 && strlen($unum) < 10) {
      $_dbhandle = OpenDB();
      $_qs = "select mi_userid, mi_rstufe from mitarbeiter where mi_num = $unum";

      if (!($_res = QueryDB($_dbhandle, $_qs))) {
         $uname = GetMessage($_dbhandle, 282, "Unknown!");
         $urole = GetMessage($_dbhandle, 283, "N/A");
      } else {
         $_data = fetchDB($_res, 0);
         $uname = $_data[0];
         $ur = $_data[1];

         switch ($ur) {
            case 0: $urole = GetMessage($_dbhandle, 283, "N/A"); break;
            case 1: $urole = GetMessage($_dbhandle, 64, "Administrator"); break;
            case 2: $urole = GetMessage($_dbhandle, 65, "Projektleiter"); break;
            case 3: $urole = GetMessage($_dbhandle, 66, "Mitarbeiter"); break;
            case 4: $urole = GetMessage($_dbhandle, 67, "Kontroller"); break;
            case 5: $urole = GetMessage($_dbhandle, 283, "N/A"); break;
            case 6: $urole = GetMessage($_dbhandle, 69, "Ressourcenmanager"); break;
            default: $urole = GetMessage($_dbhandle, 284, "Error!");
         }

         unset($ur);
      }

      unset($_res);
      unset($_qs);
   }
?>
<div id="menu">
<table border=0 cellspacing=0 cellpadding=0 class="header" width="100%">
   <tr>
      <td class="logo" width="80%">
          <table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
             <tr>
                <td><img src="image/logo.png" height="70" width="300" alt="Logo" border=0></td>
		<td align="center"><img src="image/theopath.png" height="65" width="300" alt="TheoPlan" border=0></td>
	     </tr>
	  </table>
      </td>
<?
if ($header != 3 && isset($unum) && $unum > 0 && strlen($unum) < 10) {
?>
      <td width="20%">
         <table border=0 class="logo" width="100%" height="70px" cellpadding=0>
            <tr>
               <td><? Output($_dbhandle, 285, "Anwender:"); ?></td><td><? echo "$uname"; ?></td>
            </tr>
            <tr>
               <td><? Output($_dbhandle, 286, "Rolle:"); ?></td><td><? echo "$urole"; ?></td>
            </tr>
            <tr>
               <td><? Output($_dbhandle, 287, "Datum:"); ?></td><td><? echo date("d.m.Y H:i", time()); ?></td>
            </tr>
         </table>
<?
} else {
?>
      <td class="logo" width="20%">
<?
}
?>
      </td>
   </tr>
   <tr>
      <td class="tabsnb" colspan=2>
         <table border=0 cellspacing=0 cellpadding=0>
            <tr>
<!-- Hier folgt das Menue -->
<?php
}

function ButtonSubmit($str, $form, $back=false) {
?>
<table class="button" cellpadding=0 cellspacing=0>
   <tr>
      <td><img src="nav/button_left.png" height="24px" alt=""></td>
      <td class="button">
<?
	echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:document.$form.submit()\">$str</a>\n";
?>
      <td><img src="nav/button_right.png" height="24px" alt=""></td>
      <td>&nbsp;&nbsp;</td>
      <td><img src="nav/button_left.png" height="24px" alt=""></td>
      <td class="button">
<?
	if (!$back) {
	   echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:document.$form.reset()\">";
	   Output(-1, 288, "Zur&uuml;cksetzen");
	   echo "</a>\n";
	} else {
	   echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:history.back()\">";
	   Output(-1, 289, "Abbrechen");
	   echo "</a>\n";
	}
?>
      </td>
      <td><img src="nav/button_right.png" height="24px" alt=""></td>
   </tr>
</table>
<?
}

function ButtonImage($image, $form, $alt="", $hidden="", $value="") {
	$str = "<img src=\"image/$image\" border=0 height=16 width=16 alt=\"$alt\">";
	echo "<a href=\"#\" onClick=\"javascript:";

	if (strlen($hidden) > 0 && strlen($value) > 0) {
	   echo "document.$form.$hidden.value = '$value';";
	}

	echo "document.$form.submit()\">$str</a>\n";
}

function ButtonImageMove($image, $alt, $prog, $func) {
	$str = "<img src=\"image/$image\" border=0 height=16 width=16 alt=\"$alt\">";
	echo "<a href=\"#\" onClick=\"javascript:";
	echo "MoveTo('$prog','$func')\">$str</a>\n";
}

function Button($str, $form, $hidden="", $value="") {
?>
<table class="button" cellpadding=0 cellspacing=0>
   <tr>
      <td><img src="nav/button_left.png" height="24px" alt=""></td>
      <td class="button">
<?
	if (strlen($hidden) > 0 && strlen($value) > 0) {
	   echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:";
	   echo "document.$form.$hidden.value = '$value';document.$form.submit()\"";
	   echo ">$str</a>\n";
	}
	else
	echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:document.$form.submit()\">$str</a>\n";
?>
      </td>
      <td><img src="nav/button_right.png" height="24px" alt=""></td>
   </tr>
</table>
<?
}

function ButtonProg($str, $prog) {
?>
<table class="button" cellpadding=0 cellspacing=0>
   <tr>
      <td><img src="nav/button_left.png" height="24px" alt=""></td>
      <td class="button">
<?
	echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:$prog\">$str</a>\n";
?>
      </td>
      <td><img src="nav/button_right.png" height="24px" alt=""></td>
   </tr>
</table>
<?
}

function ButtonLink($text, $prog, $func) {
?>
<table class="button" cellpadding=0 cellspacing=0>
   <tr>
      <td><img src="nav/button_left.png" height="24px" alt=""></td>
      <td class="button">
<?
	echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:MoveTo('$prog','$func')\">$text</a>\n";
?>
      </td>
      <td><img src="nav/button_right.png" height="24px" alt=""></td>
   </tr>
</table>
<?
}

function ButtonPrint($text, $prog, $func, $wtype=false) {
?>
<table class="button" cellpadding=0 cellspacing=0>
   <tr>
      <td><img src="nav/button_left.png" height="24px" alt=""></td>
      <td class="button">
<?
	if (!$wtype)
	   $ow = "open_mwindow";
	else
	   $ow = "open_window";

	echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:$ow('$prog?$func','Drucken',1000,650)\">$text</a>\n";
?>
      </td>
      <td><img src="nav/button_right.png" height="24px" alt=""></td>
   </tr>
</table>
<?
}

function ButtonImagePrint($image, $alt, $prog, $func, $width=1000, $height=650, $wtype=false) {
	$str = "<img src=\"image/$image\" border=0 height=16 width=16 alt=\"$alt\">";

	if (!$wtype)
	   $ow = "open_mwindow";
	else
	   $ow = "open_window";

	echo "<a href=\"#\" class=\"menu\" onClick=\"javascript:$ow('$prog?$func','$alt',$width,$height)\">$str</a>\n";
}
?>
